package com.qianyu.project.web.controller.zy;

import com.qianyu.project.entity.ProjectInfo;
import com.qianyu.project.entity.ProjectStatus;
import com.qianyu.project.service.IProjectStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("ZYprojectStatus")
public class ZYProjectStatusController {
    @Autowired
    IProjectStatusService ips;

    //@RequestBody ProjectStatus ps
    @GetMapping("")
    public List<ProjectStatus> getPStatus(ProjectStatus ps){
        return ips.getPStatus(ps);
    }

    //删除
    @DeleteMapping("{sid}")
    public void delStatus(String id){
        ips.delStatus(id);
    }

    //修改跳转
    @GetMapping("{sid}")
    public ProjectStatus getStatuByid(@PathVariable String sid){
        return ips.getStatuByid(sid);
    }

    //添加
    @PostMapping("")
    public void addStatus(@RequestBody ProjectStatus ps){
        ips.addStatus(ps);
    }
}
